package com.graduate.after.service.impl;

import com.graduate.after.bean.HomeCategory;
import com.graduate.after.mapper.HomeCategoryMapper;
import com.graduate.after.service.HomeCategoryService;
import com.graduate.after.web.control.UserInfoControl;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Iterator;
import java.util.List;
@Service
public class HomeCategoryServiceImpl implements HomeCategoryService {

    private static Logger log = Logger.getLogger(HomeCategoryServiceImpl.class.getClass());

    @Autowired
    private HomeCategoryMapper homeCategoryMapper;

    @Override
    public List<HomeCategory> homeCategorySelect(Integer category, Integer page) {
        List<HomeCategory> homeCategories = homeCategoryMapper.homeCategorySelect(category,page);
        Iterator<HomeCategory> iterator = homeCategories.iterator();
        while (iterator.hasNext()) {
            log.info(iterator.next().toString());
        }
        return homeCategories;
    }
}
